package com.lrs.java.j2se_self.thread;
import java.util.*;
public class TestThread3 {
	public static void main(String[] args){
		Runner r = new Runner();
		Thread t = new Thread(r);
		t.start();
		try{
			Thread.sleep(10000);
		}catch(InterruptedException e){
			e.printStackTrace();
		}
		r.shutDown();
	}
}
class Runner implements Runnable{
	private boolean flag = true;
	public void run(){
		while(flag){
			System.out.println("the thread ----"+ new Date());
			try{
				Thread.sleep(1000);
			}catch(InterruptedException e){
				return;
			}
		}
	}
	public void shutDown(){
		this.flag = false;
	}
}